<?php include $this->getViewFile('/common/Head') ?>
<body class="J_scroll_fixed">
<style>
.col-left{float:left}
.col-auto{overflow:hidden;_zoom:1;_float:left;}
.title-1{border-bottom:1px solid #eee; padding-left:5px}
.f14{font-size: 14px}
.lh28{line-height: 28px}
.blue,.blue a{color:#004499}
.gray4,a.gray4{color:#999;}
.lh22{line-height: 22px}
.lh25{line-height: 25px}
</style>
<div class="wrap J_check_wrap">
  <?php include $this->getViewFile('/common/Nav') ?>
  <div class="h_a">查找</div>
  <form method="post" action="" id="searchForm">
    <div class="search_type cc mb10">
       <div class="mb10">
         状态：<?php echo Form::select(array(0=>'未付款',1=>'已付款'),$status,'name="status"','全部') ?> 
        关键字：<?php echo Form::select(array(1=>'商品ID',2=>'订单编号',3=>'支付宝流水号'),$type,'name="type"') ?>
        <input type="text" class="input length_2" name="keyword" style="width:200px;" value="<?php echo $keyword?>" placeholder="请输入搜索内容...">
        <button class="btn">搜索</button>
      </div>
    </div>
  </form>
  <div class="mb10"> 共有 ( <b><?php echo $count; ?></b> ) 条记录</div>
  <form name="myform" action="<?php echo AdminBase::U("delete") ?>" method="post" class="J_ajaxForm">
    <div class="table_list">
      <table width="100%" cellspacing="0">
        <thead>
          <tr>
            <td width="50" align="center">ID</td>
            <td align="center">标题</td>
            <td align="center">订单金额</td>
            <td align="center">会员ID</td>
            <td align="center">订单编号</td>
            <td align="center">下单日期</td>
            <td align="center">商品ID</td>
            <td align="center">活动价</td>
            <td align="center">支付宝流水号</td>
            <td align="center">状态</td>
            <!-- <td align="center">操作</td> -->
          </tr>
        </thead>
        <tbody>
          <?php
		  foreach($data as $rs){
		  ?>
          <tr>
            <td align="center"><?php echo $rs->id ?></td>
            <td align="center"><?php echo $rs->order_title ?></td>
            <td align="center"><b><?php echo $rs->money ?></b></td>
            <td align="center"><?php echo $rs->uid ?></td>
            <td align="center"><?php echo $rs->order_sn ?></td>
            <td align="center"><?php echo date('Y-m-d H:i:s',$rs->add_time) ?></td>
            <td align="center"><a href="http://item.taobao.com/item.htm?id=<?php echo $rs->product_id ?>" target="_blank"><?php echo $rs->product_id ?></a></td>
            <td align="center"><?php echo $rs->price ?></td>
            <td align="center"><?php echo $rs->alipay_sn ?></td>
            <td align="center">
            <?php
			if($rs->status == 0){
				echo "<font color=\"#FF0000\">未付款</font>";
			}else if($rs->status == 1){
				echo "已付款";
			}else if($rs->status == 2){
				echo "已付款,已上活动";
			}
			?>
<!--             </td>
            <td align="center">
            <?php
/*			$op = array();
			if(RBAC::authenticate('activity') && $rs->status==1){
				$op[] = '<a class="J_ajax_queren" href="'.AdminBase::U("activity",array('id'=>$rs->id)).'" >确认已上活动</a>';
			}
			echo implode(' | ',$op);*/
			?>
            </td> -->
          </tr>
          <?php
		  }
		  ?>
        </tbody>
      </table>
      <div class="p10">
        <div class="pages"><?php echo $Page;?></div>
      </div>
    </div>
  </form>
</div>
<script src="<?php echo $staticUrl; ?>statics/js/common.js"></script>
<script>
$(function(){
	//所有的删除操作，删除数据后刷新页面
    if ($('a.J_ajax_queren').length) {
        Wind.use('artDialog','iframeTools', function () {
            $('.J_ajax_queren').on('click', function (e) {
                e.preventDefault();
                var $_this = this,
                    $this = $($_this),
                    href = $this.prop('href'),
                    msg = $this.data('msg');
                art.dialog({
                    title: false,
                    icon: 'question',
                    content: '确认已经上活动？',
                    follow: $_this,
                    close: function () {
                        $_this.focus();; //关闭时让触发弹窗的元素获取焦点
                        return true;
                    },
                    ok: function () {
                        $.getJSON(href).done(function (data) {
                            if (data.state === 'success') {
                                if (data.referer) {
                                    location.href = data.referer;
                                } else {
                                    reloadPage(window);
                                }
                            } else if (data.state === 'fail') {
                                art.dialog.alert(data.info);
                            }
                        });
                    },
                    cancelVal: '关闭',
                    cancel: true
                });
            });

        });
    }
});
</script>
</body>
</html>